import * as React from "react"
import { observable } from "mobx"
import { observer, inject } from "mobx-react"
import FN from "../tools/fn"
import {Link} from "react-router-dom"
import ErrorBoundary from "../../components/errorBoundary"

@inject("article")
@inject("RouteQ")
@observer
export default class Article extends React.Component {

  constructor(props) {
    super(props)
    this.store = this.props.article.data
    this.listStore=this.props.RouteQ;
    console.log("文章：",this.store)
  }

  clearListCache(){
    this.listStore.setCache("/cacheRoute/list",false)
  }
  render() {
    return (
        <div className="am-article" id="article">
            <h2>{this.store.title}</h2>
            <p>
            <a onClick={()=>{this.clearListCache()}}  className="am-button tiny-blue" role="button">清空列表路由缓存</a>
            </p>
            <time><span className="am-ft-black">{this.store.author.loginname}</span> {this.store.create_at}</time>
            <div   dangerouslySetInnerHTML={{__html:this.store.content}}>
          
            </div>
            <blockquote>
                本内容由“{this.store.author.loginname}”授权，如果有任何疑问请与“{this.store.author.loginname}”联系。
            </blockquote>
            <div className="am-article-tags">
                <span className="am-tag-item">电影</span>
                <span className="am-tag-item">战争</span>
                <span className="am-tag-item">二战</span>
            </div>
        </div>
    )
  
}


